package com.hw.paltfrom.pack;


import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import com.hw.paltfrom.pack.ResponseCode;

public class ResponseResult implements Serializable{
	private static final long serialVersionUID = 319987396861861088L;
	
	
	public static Map<String,Object> success(ResponseCode code){
		HashMap<String, Object> result = new HashMap<>();
		result.put("code", code.code());
		result.put("msg", code.msg());
		return result;
	}
	public static Map<String,Object> successNotice(ResponseCode code,Object parms){
		HashMap<String, Object> result = new HashMap<>();
		result.put("code", code.code());
		result.put("msg", code.msg());
		result.put("data", parms);
		return result;
	}
	
	
	public static Map<String, Object> fail(ResponseCode code){
		HashMap<String, Object> result = new HashMap<>();
		result.put("code", code.code());
		result.put("msg", code.msg());
		return result;
	}
	public static Map<String,Object> failNotice(ResponseCode code,Object parms){
		HashMap<String, Object> result = new HashMap<>();
		result.put("code", code.code());
		result.put("msg", code.msg());
		result.put("data", parms);
		return result;
	}
}


